<template>
  <div class="content-wrapper">
    <div class="action-wrapper">
      <el-button
        type="primary"
        size="small"
        icon="el-icon-position"
      >
        <router-link :to="'/deploy/proccess?projectId=' + projectId">
          进入部署
        </router-link>
      </el-button>
    </div>
    <div class="content">
      <el-collapse v-model="activeTabName" accordion>
        <el-collapse-item title="代码项目基本信息" name="overview">
          <dp-server-info :project-id.sync="projectId" />
        </el-collapse-item>
        <el-collapse-item title="部署集群选择" name="k8sConfig">
          <dp-server-k8s-config :project-id.sync="projectId" />
        </el-collapse-item>
        <el-collapse-item title="容器镜像构建配置" name="buildConfig">
          <dp-server-build-config :project-id.sync="projectId" />
        </el-collapse-item>
        <el-collapse-item title="部署参数配置" name="deployConfig">
          <dp-server-deploy-config :project-id.sync="projectId" />
        </el-collapse-item>
        <el-collapse-item title="服务的环境变量配置" name="environment">
          <dp-server-env :project-id.sync="projectId" />
        </el-collapse-item>
      </el-collapse>
    </div>
  </div>
</template>

<script>

import DpServerInfo from './config/DpServerInfo'
import DpServerBuildConfig from './config/DpServerBuildConfig'
import DpServerDeployConfig from './config/DpServerDeployConfig'
import DpServerK8sConfig from './config/DpServerK8sConfig'
import DpServerEnv from './config/DpServerEnv'

export default {
  name: 'DpServerConfig',
  components: {
    DpServerInfo,
    DpServerBuildConfig,
    DpServerDeployConfig,
    DpServerK8sConfig,
    DpServerEnv
  },
  props: {
    projectId: {
      type: Number,
      default: () => { return -1 }
    }
  },
  data() {
    return {
      activeTabName: 'overview'
    }
  },
  computed: {
  },
  watch: {
  },
  created() {
    this.activeTabName = 'overview'
  },
  mounted() {
  },
  methods: {
    onTabClick(tab) {
    }
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  .selector {
    display: flex;
    align-items: center;
    position: absolute;
    right: 48px;
    /*float: right;*/
    z-index: 999;
    margin-top: 5px;
  }

  .selector .el-select {
    height: 30px;
    line-height: 30px;
    padding-left: 10px;
    width: 180px;
    border-radius: 0;
  }

  .selector .el-select > > > .el-input__icon,
  .selector .el-select > > > .el-input__inner {
    border-radius: 0;
    height: 30px;
    line-height: 30px;
  }

  .label {
    text-align: right;
    width: 80px;
    color: #909399;
    font-weight: 100;
  }

  .content-wrapper {
    width: 100%;
    padding-bottom: 100px;
    padding-top: 15px;
  }

  .content {
    margin-top: 20px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    max-width: 1024px;
    display: block;
  }

  .action-wrapper {
    mairgin-top: 10px;
    padding-left: 10px;
    text-align: left;
    padding-bottom: 10px;
    border-bottom: 1px solid #DCDFE6;
  }

  ::v-deep .el-collapse-item__header {
    font-size:17px;
  }
</style>
